package com.net.marketing.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

import com.net.marketing.domain.MemberDetails;

/**
 *@Author pao quilala
 *@Date   Aug 10, 2012
 **/

public class MemberDetailsRowMapper implements ParameterizedRowMapper<MemberDetails> {

	public MemberDetails mapRow(ResultSet rs, int rowNum) throws SQLException {
		MemberDetails memberDetails = new MemberDetails();		
		memberDetails.setMemberId(rs.getLong("MEMBER_ID"));
		memberDetails.setSponsorId(rs.getLong("SPONSOR_ID"));
		memberDetails.setGroupId(rs.getString("GROUP_ID"));
		memberDetails.setFirstName(rs.getString("FIRST_NAME"));
		memberDetails.setMiddleName(rs.getString("MIDDLE_NAME"));
		memberDetails.setLastName(rs.getString("LAST_NAME"));
		memberDetails.setAddress(rs.getString("ADDRESS"));
		memberDetails.setZipCode(rs.getString("ZIPCODE"));
		memberDetails.setContactNo(rs.getString("CONTACT_NO"));
		memberDetails.setBirthDate(rs.getDate("BIRTHDATE"));
		memberDetails.setAge(rs.getString("AGE"));
		memberDetails.setSex(rs.getString("SEX"));
		memberDetails.setStatus(rs.getString("STATUS"));
		memberDetails.setNationality(rs.getString("NATIONALITY"));		
		return memberDetails;
	}
}
